var api = require('../../utils/api.js');
var date = require('../../utils/date.js');

var app = getApp();



Page({

    /**
     * 页面的初始数据
     */
    data: {
        key:'',
        types:0,
        lists:[]
    },

    // 获取列表

    getmyclient(){
        var that=this;
        var key=this.data.key;
        var types=this.data.types;


        api.post({
            url: 'client/getmyclient',
            data: {'keys':key,'types':types},
            success: data => {
               console.log(data);
               that.setData({
                    lists:data.data
                })

            }
        });
    },

    seeinfo(ret){
        console.log(ret);
        var id=ret.currentTarget.dataset.id;

        wx.navigateTo({
          url: '/pages/list/info?id='+id
        })

    },


    onLoad(options) {
        this.getmyclient();

    },
    getalllistbykey(ret){
        console.log(ret);

        this.setData({
            key:ret.detail.value,
            lists:[]
        })

        this.getmyclient();
        
    },
    gettypes(ret){
        console.log(ret);
        var i=ret.currentTarget.dataset.i;
        this.setData({
            types:i,
            lists:[]
        })

        this.getmyclient();
    },


    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },


})